import request from '@/router/axios';

// 获取分组列表
export const getList = (params) => {
    return request({
        url: '/api/cache-api/redis-manager/getKeyGroup',
        method: 'get',
        params: {
            ...params,
        }
    })
}
// 缓存详情
export const cacheDetail = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/detail',
        method: 'post',
        data: { ...data }
    })
}
// 分组下键分页列表
export const getKeyList = (params) => {
    return request({
        url: '/api/cache-api/redis-manager/query',
        method: 'get',
        params: {
            ...params,
        }
    })
}
// 更改缓存键名
export const updateKeyName = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/name/update',
        method: 'post',
        data: { ...data }
    })
}
// 更新缓存失效时间
export const updateKeyTime = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/expire/update',
        method: 'post',
        data: { ...data }
    })
}
// 更新缓存值
export const updateKeyValue = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/value/update',
        method: 'post',
        data: { ...data }
    })
}

// 删除缓存key
export const delKey = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/delete',
        method: 'post',
        data
    })
}
// 删除分组
export const delGroup = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/deleteGroup',
        method: 'post',
        data
    })
}

// 添加备注
export const groupRemark = (data) => {
    return request({
        url: '/api/cache-api/redis-manager/groupRemark',
        method: 'post',
        data
    })
}

